package io.renren.modules.pet.enums;

import lombok.Getter;

@Getter
public enum ApplicantMarriageEnum {

    STATUS_0(0, "单身"),
    STATUS_1(1, "恋爱中"),
    STATUS_2(2, "已婚");

    private Integer index;
    private String chn;

    ApplicantMarriageEnum(Integer index, String chn) {
        this.index = index;
        this.chn = chn;
    }

    /**
     * 通过索引获取中文表示
     * @param index
     * @return
     */
    public static String getChnByIndex (int index) {
        ApplicantMarriageEnum[] applicantMarriageEnums = ApplicantMarriageEnum.values();
        for (ApplicantMarriageEnum applicantMarriageEnum : applicantMarriageEnums) {
            if (applicantMarriageEnum.index.equals(index)) {
                return applicantMarriageEnum.chn;
            }
        }
        return null;
    }
}
